package com.example.demo.controller;

import com.example.demo.config.MyTestConfigurationProperties;
import com.example.demo.dto.UserDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
public class TestController {
    /**
     * xxxxxxxxx
     */
    @Value("${xx.xxx:xxx}")
    private String xxx;

    @Autowired
    private MyTestConfigurationProperties myTestConfigurationProperties;

    @GetMapping("/test1")
    public String test1() {
        return this.xxx;
    }

    /**
     * GET
     * POST
     *
     * @return
     */
    @GetMapping("/test2")
    public MyTestConfigurationProperties test2() {
        return this.myTestConfigurationProperties;
    }

    @PostMapping(value = "test-post")
    public UserDto test(@RequestBody UserDto u) {
        return u;
    }
}
